package ru.pstu.itas.cps.controls;

public class Switch extends Flag implements HasStates, Touchable {

	int radius;

	public Switch(String id, int x, int y, int value, int radius) {
		super(id, x, y, value);
		this.radius = radius;
	}

	public void TouchDown(float x, float y) {
		if ((x - this.x) * (x - this.x) + (y - this.y) * (y - this.y) < radius * radius) {
			if (value + 1 >= imgs.size()) {
				setValue(0);
			} else {
				setValue(value + 1);
			}
		}
	}

	public void TouchMove(float x, float y) {
		// TODO Auto-generated method stub
	}

	public void TouchUp(float x, float y) {
		// TODO Auto-generated method stub
	}

}
